import service from '../utils/request'

//1.登录
export function user_login(payload = {}) {
    return service.post('/user/login', payload);
}
//2. 验证手机号码是否被注册过
export function user_findphone(payload = {}) {
    return service.post('/user/docheckphone', payload);
}
//3.发送短信验证码
export function user_sendcode(payload = {}) {
    return service.post('/user/dosendmsgcode', payload);
}
//4.验证短信验证码
export function user_checkcode(payload = {}) {
    return service.post('/user/docheckcode', payload);
}
//5.注册
export function user_register(payload = {}) {
    return service.post('/user/dofinishregister', payload);
}
//6.绑定用户名
export function bindusername(payload = {}) {
    return service.get('/user/bindusername', { params: payload });
}
//7.查看轮播图
export function banner(payload = {}) {
    return service.get('/banner/list', { params: payload });
}
//8.获取秒杀产品列表的数据
export function seckill(payload = {}) {
    return service.get('/pro/seckilllist', { params: payload });
}
//9.获取商品分页列表数据
export function goodlist(payload = {}) {
    return service.get('/pro/list', { params: payload });
}
//10.分类列表
export function catelist(payload = {}) {
    return service.get('pro/categorylist', { params: payload });
}
//11.获取产品的详情数据
export function good(payload = {}) {
    return service.get('/pro/detail/:proid', { params: payload });
}
//12.获取推荐产品列表的数据
export function goodlikelist(payload = {}) {
    return service.get('/pro/recommendlist', { params: payload });
}
//13.查看购物车
export function cart_list(payload = {}) {
    return service.post('/cart/list', payload);
}
//14. 产品的分类列表
export function categorylist(payload = {}) {
    return service.get('/pro/categorylist', { params: payload });
}
//15.产品分类下品牌列表
export function categorybrandlist(payload = {}) {
    return service.get('/pro/categorybrandlist', { params: payload });
}
//16.获取某分类下某品牌的产品列表
export function categorybrandprolist(payload = {}) {
    return service.get('/pro/categorybrandprolist', { params: payload });
}
//17.获取用户信息
export function getuserinfo(payload = {}) {
    return service.get('/user/info', { params: payload });
}
//18.热门搜索
export function pro_hotword(payload = {}) {
    return service.get('/pro/hotword', { params: payload });
}
//19.搜索列表
export function searchlist(payload = {}) {
    return service.get('/pro/search', { params: payload });
}
//20.地址列表
export function addresslist(payload = {}) {
    return service.get('/address/list', { params: payload });
}
//21.添加地址
export function address_add(payload = {}) {
    return service.post('/address/add', payload);
}
//22.更新地址接口
export function address_update(payload = {}) {
    return service.post('/address/update', payload);
}
//23.删除地址
export function address_delete(payload = {}) {
    return service.post('/address/delete', payload);
}
//24.加入购物车
export function cart_add(payload = {}) {
    return service.post('/cart/add', payload)
}
//25.更新当前购物车数据的选中状态
export function cart_selectone(payload = {}) {
    return service.post('/cart/selectone', payload)
}
//26.更新购物车数量
export function cart_updatenum(payload = {}) {
    return service.post('/cart/updatenum', payload)
}
//27.更新所有购物车数据的选中状态
export function cart_selectall(payload = {}) {
    return service.post('/cart/selectall', payload)
}
//28.清空购物车
export function cart_removeall(payload = {}) {
    return service.post('/cart/removeall', payload)
}
//29.删除购物车单条数据
export function cart_remove(payload = {}) {
    return service.post('/cart/remove', payload)
}
//30.更改密码
export function updatepass(payload = {}) {
    return service.get('/user/updatePassword', { params: payload });
}
//31.查询默认地址
export function defaultAddress(payload = {}) {
    return service.post('/address/defaultAddress', payload)
}




//32.查询城市
export function City(canshu = {}) {
    return service.get('/city/sortCity.json', { params: canshu })
}
//33.添加订单
export function addOrder(payload = {}) {
    return service.post('/order/addOrder', payload)
}
//34.确认订单信息
export function confirmOrder(canshu = {}) {
    return service.get('/order/confirmOrder', { params: canshu })
}